# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1046.69.6 -> 1.1046.69.7 # include/asm-i386/ptrace.h 1.5 -> 1.6 # arch/i386/kernel/traps.c 1.51 -> 1.51.1.1 # drivers/net/tulip/media.c 1.11 -> 1.12 # drivers/char/mem.c 1.35 -> 1.35.1.1 # fs/proc/base.c 1.42 -> 1.43 # sound/oss/cs4281/cs4281pm-24.c 1.3 -> 1.4 # fs/fcntl.c 1.25 -> 1.25.1.1 # include/linux/jbd.h 1.21 -> 1.22 # drivers/scsi/sym53c8xx_2/sym_malloc.c 1.2 -> 1.3 # drivers/video/radeonfb.c 1.26 -> 1.27 # include/asm-i386/hw_irq.h 1.21 -> 1.22 # sound/oss/cs4281/cs4281m.c 1.21 -> 1.22 # drivers/scsi/qla1280.c 1.32 -> 1.32.1.1 # drivers/scsi/sym53c8xx_2/sym_glue.c 1.18 -> 1.18.1.1 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/05/14 davidm@tiger.hpl.hp.com 1.1046.69.7 # Various minor driver fixes. # -------------------------------------------- # diff -Nru a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c --- a/arch/i386/kernel/traps.c Mon Sep 22 12:59:08 2003 +++ b/arch/i386/kernel/traps.c Mon Sep 22 12:59:08 2003 @@ -92,13 +92,15 @@ static int kstack_depth_to_print = 24; -void show_trace(unsigned long * stack) +void show_trace(struct task_struct *task) { int i; - unsigned long addr; + unsigned long addr, *stack; - if (!stack) - stack = (unsigned long*)&stack; + if (!task) + stack = (unsigned long*)&task; + else + stack = (unsigned long *) task->thread.esp; printk("Call Trace:"); #if CONFIG_KALLSYMS @@ -122,19 +124,21 @@ /* User space on another CPU? */ if ((esp ^ (unsigned long)tsk->thread_info) & (PAGE_MASK<<1)) return; - show_trace((unsigned long *)esp); + show_trace(tsk); } -void show_stack(unsigned long * esp) +void show_stack(struct task_struct *task) { - unsigned long *stack; + unsigned long *stack, *esp; int i; // debugging aid: "show_stack(NULL);" prints the // back trace for this cpu. - if(esp==NULL) - esp=(unsigned long*)&esp; + if(task==NULL) + esp=(unsigned long*)&task; + else + esp = (unsigned long*)task->thread.esp; stack = esp; for(i=0; i < kstack_depth_to_print; i++) { @@ -145,7 +149,7 @@ printk("%08lx ", *stack++); } printk("\n"); - show_trace(esp); + show_trace(task); } /* @@ -153,9 +157,7 @@ */ void dump_stack(void) { - unsigned long stack; - - show_trace(&stack); + show_trace(NULL); } void show_registers(struct pt_regs *regs) @@ -192,7 +194,7 @@ if (in_kernel) { printk("\nStack: "); - show_stack((unsigned long*)esp); + show_stack(NULL); printk("Code: "); if(regs->eip < PAGE_OFFSET) diff -Nru a/drivers/char/mem.c b/drivers/char/mem.c --- a/drivers/char/mem.c Mon Sep 22 12:59:08 2003 +++ b/drivers/char/mem.c Mon Sep 22 12:59:08 2003 @@ -71,7 +71,8 @@ unsigned long p = *ppos; unsigned long end_mem; ssize_t read; - + void *addr; + end_mem = __pa(high_memory); if (p >= end_mem) return 0; @@ -94,8 +95,14 @@ } } #endif - if (copy_to_user(buf, __va(p), count)) + if (file->f_flags & O_SYNC) + addr = ioremap(p, count); + else + addr = __va(p); + if (copy_to_user(buf, addr, count)) return -EFAULT; + if (file->f_flags & O_SYNC) + iounmap(addr); read += count; *ppos += read; return read; @@ -106,13 +113,22 @@ { unsigned long p = *ppos; unsigned long end_mem; + ssize_t ret; + void *addr; end_mem = __pa(high_memory); if (p >= end_mem) return 0; if (count > end_mem - p) count = end_mem - p; - return do_write_mem(file, __va(p), p, buf, count, ppos); + if (file->f_flags & O_SYNC) + addr = ioremap(p, count); + else + addr = __va(p); + ret = do_write_mem(file, addr, p, buf, count, ppos); + if (file->f_flags & O_SYNC) + iounmap(addr); + return ret; } #ifndef pgprot_noncached @@ -522,17 +538,19 @@ */ static loff_t memory_lseek(struct file * file, loff_t offset, int orig) { - int ret; + loff_t ret; lock_kernel(); switch (orig) { case 0: file->f_pos = offset; ret = file->f_pos; + force_successful_syscall_return(); break; case 1: file->f_pos += offset; ret = file->f_pos; + force_successful_syscall_return(); break; default: ret = -EINVAL; diff -Nru a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c --- a/drivers/net/tulip/media.c Mon Sep 22 12:59:08 2003 +++ b/drivers/net/tulip/media.c Mon Sep 22 12:59:08 2003 @@ -278,6 +278,10 @@ for (i = 0; i < init_length; i++) outl(init_sequence[i], ioaddr + CSR12); } + + (void) inl(ioaddr + CSR6); /* flush CSR12 writes */ + udelay(500); /* Give MII time to recover */ + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c --- a/drivers/scsi/qla1280.c Mon Sep 22 12:59:08 2003 +++ b/drivers/scsi/qla1280.c Mon Sep 22 12:59:08 2003 @@ -284,7 +284,7 @@ #define QL1280_TARGET_MODE_SUPPORT 0 /* Target mode support */ #define QL1280_LUN_SUPPORT 0 #define WATCHDOGTIMER 0 -#define MEMORY_MAPPED_IO 0 +#define MEMORY_MAPPED_IO 1 #define DEBUG_QLA1280_INTR 0 #define USE_NVRAM_DEFAULTS 0 #define DEBUG_PRINT_NVRAM 0 @@ -2634,7 +2634,7 @@ /* * Get memory mapped I/O address. */ - pci_read_config_word (ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); + pci_read_config_dword (ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; /* diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c --- a/drivers/scsi/sym53c8xx_2/sym_glue.c Mon Sep 22 12:59:08 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c Mon Sep 22 12:59:08 2003 @@ -295,11 +295,7 @@ #ifndef SYM_LINUX_DYNAMIC_DMA_MAPPING typedef u_long bus_addr_t; #else -#if SYM_CONF_DMA_ADDRESSING_MODE > 0 -typedef dma64_addr_t bus_addr_t; -#else typedef dma_addr_t bus_addr_t; -#endif #endif /* diff -Nru a/drivers/scsi/sym53c8xx_2/sym_malloc.c b/drivers/scsi/sym53c8xx_2/sym_malloc.c --- a/drivers/scsi/sym53c8xx_2/sym_malloc.c Mon Sep 22 12:59:08 2003 +++ b/drivers/scsi/sym53c8xx_2/sym_malloc.c Mon Sep 22 12:59:08 2003 @@ -150,7 +150,6 @@ ((m_link_p) a)->next = h[i].next; h[i].next = (m_link_p) a; #endif - break; } b = a ^ s; q = &h[i]; diff -Nru a/drivers/video/radeonfb.c b/drivers/video/radeonfb.c --- a/drivers/video/radeonfb.c Mon Sep 22 12:59:08 2003 +++ b/drivers/video/radeonfb.c Mon Sep 22 12:59:08 2003 @@ -2840,8 +2840,7 @@ } /* map the regions */ - rinfo->mmio_base = (u32) ioremap (rinfo->mmio_base_phys, - RADEON_REGSIZE); + rinfo->mmio_base = (unsigned long) ioremap (rinfo->mmio_base_phys, RADEON_REGSIZE); if (!rinfo->mmio_base) { printk ("radeonfb: cannot map MMIO\n"); release_mem_region (rinfo->mmio_base_phys, @@ -2978,8 +2977,7 @@ } } - rinfo->fb_base = (u32) ioremap (rinfo->fb_base_phys, - rinfo->video_ram); + rinfo->fb_base = (unsigned long) ioremap (rinfo->fb_base_phys, rinfo->video_ram); if (!rinfo->fb_base) { printk ("radeonfb: cannot map FB\n"); iounmap ((void*)rinfo->mmio_base); diff -Nru a/fs/fcntl.c b/fs/fcntl.c --- a/fs/fcntl.c Mon Sep 22 12:59:08 2003 +++ b/fs/fcntl.c Mon Sep 22 12:59:08 2003 @@ -320,6 +320,7 @@ * to fix this will be in libc. */ err = filp->f_owner.pid; + force_successful_syscall_return(); break; case F_SETOWN: err = f_setown(filp, arg, 1); diff -Nru a/fs/proc/base.c b/fs/proc/base.c --- a/fs/proc/base.c Mon Sep 22 12:59:08 2003 +++ b/fs/proc/base.c Mon Sep 22 12:59:08 2003 @@ -534,7 +534,24 @@ } #endif +static loff_t mem_lseek(struct file * file, loff_t offset, int orig) +{ + switch (orig) { + case 0: + file->f_pos = offset; + break; + case 1: + file->f_pos += offset; + break; + default: + return -EINVAL; + } + force_successful_syscall_return(); + return file->f_pos; +} + static struct file_operations proc_mem_operations = { + .llseek = mem_lseek, .read = mem_read, .write = mem_write, .open = mem_open, diff -Nru a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h --- a/include/asm-i386/hw_irq.h Mon Sep 22 12:59:08 2003 +++ b/include/asm-i386/hw_irq.h Mon Sep 22 12:59:08 2003 @@ -117,4 +117,6 @@ static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} #endif +extern irq_desc_t irq_desc [NR_IRQS]; + #endif /* _ASM_HW_IRQ_H */ diff -Nru a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h --- a/include/asm-i386/ptrace.h Mon Sep 22 12:59:08 2003 +++ b/include/asm-i386/ptrace.h Mon Sep 22 12:59:08 2003 @@ -57,6 +57,7 @@ #ifdef __KERNEL__ #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) #define instruction_pointer(regs) ((regs)->eip) +#define force_successful_syscall_return() do { } while (0) #endif #endif diff -Nru a/include/linux/jbd.h b/include/linux/jbd.h --- a/include/linux/jbd.h Mon Sep 22 12:59:08 2003 +++ b/include/linux/jbd.h Mon Sep 22 12:59:08 2003 @@ -279,9 +279,9 @@ printk(KERN_ERR why); \ } \ } while (0) -#define J_EXPECT(expr, why...) __journal_expect(expr, ## why) -#define J_EXPECT_BH(bh, expr, why...) __journal_expect(expr, ## why) -#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, ## why) +#define J_EXPECT(expr, why...) __journal_expect(expr, why) +#define J_EXPECT_BH(bh, expr, why...) __journal_expect(expr, why) +#define J_EXPECT_JH(jh, expr, why...) __journal_expect(expr, why) #endif enum jbd_state_bits { diff -Nru a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c --- a/sound/oss/cs4281/cs4281m.c Mon Sep 22 12:59:08 2003 +++ b/sound/oss/cs4281/cs4281m.c Mon Sep 22 12:59:08 2003 @@ -1944,8 +1944,8 @@ len -= x; } CS_DBGOUT(CS_WAVE_WRITE, 4, printk(KERN_INFO - "cs4281: clear_advance(): memset %d at 0x%.8x for %d size \n", - (unsigned)c, (unsigned)((char *) buf) + bptr, len)); + "cs4281: clear_advance(): memset %d at %p for %d size \n", + (unsigned)c, ((char *) buf) + bptr, len)); memset(((char *) buf) + bptr, c, len); } @@ -1980,9 +1980,8 @@ wake_up(&s->dma_adc.wait); } CS_DBGOUT(CS_PARMS, 8, printk(KERN_INFO - "cs4281: cs4281_update_ptr(): s=0x%.8x hwptr=%d total_bytes=%d count=%d \n", - (unsigned)s, s->dma_adc.hwptr, - s->dma_adc.total_bytes, s->dma_adc.count)); + "cs4281: cs4281_update_ptr(): s=%p hwptr=%d total_bytes=%d count=%d \n", + s, s->dma_adc.hwptr, s->dma_adc.total_bytes, s->dma_adc.count)); } // update DAC pointer // @@ -2014,11 +2013,10 @@ // Continue to play silence until the _release. // CS_DBGOUT(CS_WAVE_WRITE, 6, printk(KERN_INFO - "cs4281: cs4281_update_ptr(): memset %d at 0x%.8x for %d size \n", + "cs4281: cs4281_update_ptr(): memset %d at %p for %d size \n", (unsigned)(s->prop_dac.fmt & (AFMT_U8 | AFMT_U16_LE)) ? 0x80 : 0, - (unsigned)s->dma_dac.rawbuf, - s->dma_dac.dmasize)); + s->dma_dac.rawbuf, s->dma_dac.dmasize)); memset(s->dma_dac.rawbuf, (s->prop_dac. fmt & (AFMT_U8 | AFMT_U16_LE)) ? @@ -2049,9 +2047,8 @@ } } CS_DBGOUT(CS_PARMS, 8, printk(KERN_INFO - "cs4281: cs4281_update_ptr(): s=0x%.8x hwptr=%d total_bytes=%d count=%d \n", - (unsigned) s, s->dma_dac.hwptr, - s->dma_dac.total_bytes, s->dma_dac.count)); + "cs4281: cs4281_update_ptr(): s=%p hwptr=%d total_bytes=%d count=%d \n", + s, s->dma_dac.hwptr, s->dma_dac.total_bytes, s->dma_dac.count)); } } @@ -2182,8 +2179,7 @@ VALIDATE_STATE(s); CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO - "cs4281: mixer_ioctl(): s=0x%.8x cmd=0x%.8x\n", - (unsigned) s, cmd)); + "cs4281: mixer_ioctl(): s=%p cmd=0x%.8x\n", s, cmd)); #if CSDEBUG cs_printioctl(cmd); #endif @@ -2748,9 +2744,8 @@ CS_DBGOUT(CS_FUNCTION, 2, printk(KERN_INFO "cs4281: CopySamples()+ ")); CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO - " dst=0x%x src=0x%x count=%d iChannels=%d fmt=0x%x\n", - (unsigned) dst, (unsigned) src, (unsigned) count, - (unsigned) iChannels, (unsigned) fmt)); + " dst=%p src=%p count=%d iChannels=%d fmt=0x%x\n", + dst, src, (unsigned) count, (unsigned) iChannels, (unsigned) fmt)); // Gershwin does format conversion in hardware so normally // we don't do any host based coversion. The data formatter @@ -2830,9 +2825,9 @@ void *src = hwsrc; //default to the standard destination buffer addr CS_DBGOUT(CS_FUNCTION, 6, printk(KERN_INFO - "cs_copy_to_user()+ fmt=0x%x fmt_o=0x%x cnt=%d dest=0x%.8x\n", + "cs_copy_to_user()+ fmt=0x%x fmt_o=0x%x cnt=%d dest=%p\n", s->prop_adc.fmt, s->prop_adc.fmt_original, - (unsigned) cnt, (unsigned) dest)); + (unsigned) cnt, dest)); if (cnt > s->dma_adc.dmasize) { cnt = s->dma_adc.dmasize; @@ -2877,7 +2872,7 @@ unsigned copied = 0; CS_DBGOUT(CS_FUNCTION | CS_WAVE_READ, 2, - printk(KERN_INFO "cs4281: cs4281_read()+ %d \n", count)); + printk(KERN_INFO "cs4281: cs4281_read()+ %Zu \n", count)); VALIDATE_STATE(s); if (ppos != &file->f_pos) @@ -2900,7 +2895,7 @@ // while (count > 0) { CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO - "_read() count>0 count=%d .count=%d .swptr=%d .hwptr=%d \n", + "_read() count>0 count=%Zu .count=%d .swptr=%d .hwptr=%d \n", count, s->dma_adc.count, s->dma_adc.swptr, s->dma_adc.hwptr)); spin_lock_irqsave(&s->lock, flags); @@ -2957,11 +2952,10 @@ // the "cnt" is the number of bytes to read. CS_DBGOUT(CS_WAVE_READ, 2, printk(KERN_INFO - "_read() copy_to cnt=%d count=%d ", cnt, count)); + "_read() copy_to cnt=%d count=%Zu ", cnt, count)); CS_DBGOUT(CS_WAVE_READ, 8, printk(KERN_INFO - " .dmasize=%d .count=%d buffer=0x%.8x ret=%d\n", - s->dma_adc.dmasize, s->dma_adc.count, - (unsigned) buffer, ret)); + " .dmasize=%d .count=%d buffer=%p ret=%Zd\n", + s->dma_adc.dmasize, s->dma_adc.count, buffer, ret)); if (cs_copy_to_user (s, buffer, s->dma_adc.rawbuf + swptr, cnt, &copied)) @@ -2977,7 +2971,7 @@ start_adc(s); } CS_DBGOUT(CS_FUNCTION | CS_WAVE_READ, 2, - printk(KERN_INFO "cs4281: cs4281_read()- %d\n", ret)); + printk(KERN_INFO "cs4281: cs4281_read()- %Zd\n", ret)); return ret; } @@ -2993,7 +2987,7 @@ int cnt; CS_DBGOUT(CS_FUNCTION | CS_WAVE_WRITE, 2, - printk(KERN_INFO "cs4281: cs4281_write()+ count=%d\n", + printk(KERN_INFO "cs4281: cs4281_write()+ count=%Zu\n", count)); VALIDATE_STATE(s); @@ -3049,7 +3043,7 @@ start_dac(s); } CS_DBGOUT(CS_FUNCTION | CS_WAVE_WRITE, 2, - printk(KERN_INFO "cs4281: cs4281_write()- %d\n", ret)); + printk(KERN_INFO "cs4281: cs4281_write()- %Zd\n", ret)); return ret; } @@ -3170,8 +3164,7 @@ int val, mapped, ret; CS_DBGOUT(CS_FUNCTION, 4, printk(KERN_INFO - "cs4281: cs4281_ioctl(): file=0x%.8x cmd=0x%.8x\n", - (unsigned) file, cmd)); + "cs4281: cs4281_ioctl(): file=%p cmd=0x%.8x\n", file, cmd)); #if CSDEBUG cs_printioctl(cmd); #endif @@ -3601,8 +3594,8 @@ (struct cs4281_state *) file->private_data; CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 2, printk(KERN_INFO - "cs4281: cs4281_release(): inode=0x%.8x file=0x%.8x f_mode=%d\n", - (unsigned) inode, (unsigned) file, file->f_mode)); + "cs4281: cs4281_release(): inode=%p file=%p f_mode=%d\n", + inode, file, file->f_mode)); VALIDATE_STATE(s); @@ -3636,8 +3629,8 @@ struct list_head *entry; CS_DBGOUT(CS_FUNCTION | CS_OPEN, 2, printk(KERN_INFO - "cs4281: cs4281_open(): inode=0x%.8x file=0x%.8x f_mode=0x%x\n", - (unsigned) inode, (unsigned) file, file->f_mode)); + "cs4281: cs4281_open(): inode=%p file=%p f_mode=0x%x\n", + inode, file, file->f_mode)); list_for_each(entry, &cs4281_devs) { @@ -4347,10 +4340,8 @@ CS_DBGOUT(CS_INIT, 2, printk(KERN_INFO - "cs4281: probe() BA0=0x%.8x BA1=0x%.8x pBA0=0x%.8x pBA1=0x%.8x \n", - (unsigned) temp1, (unsigned) temp2, - (unsigned) s->pBA0, (unsigned) s->pBA1)); - + "cs4281: probe() BA0=0x%.8x BA1=0x%.8x pBA0=%p pBA1=%p \n", + (unsigned) temp1, (unsigned) temp2, s->pBA0, s->pBA1)); CS_DBGOUT(CS_INIT, 2, printk(KERN_INFO "cs4281: probe() pBA0phys=0x%.8x pBA1phys=0x%.8x\n", @@ -4397,15 +4388,13 @@ if (pmdev) { CS_DBGOUT(CS_INIT | CS_PM, 4, printk(KERN_INFO - "cs4281: probe() pm_register() succeeded (0x%x).\n", - (unsigned)pmdev)); + "cs4281: probe() pm_register() succeeded (%p).\n", pmdev)); pmdev->data = s; } else { CS_DBGOUT(CS_INIT | CS_PM | CS_ERROR, 0, printk(KERN_INFO - "cs4281: probe() pm_register() failed (0x%x).\n", - (unsigned)pmdev)); + "cs4281: probe() pm_register() failed (%p).\n", pmdev)); s->pm.flags |= CS4281_PM_NOT_REGISTERED; } #endif diff -Nru a/sound/oss/cs4281/cs4281pm-24.c b/sound/oss/cs4281/cs4281pm-24.c --- a/sound/oss/cs4281/cs4281pm-24.c Mon Sep 22 12:59:08 2003 +++ b/sound/oss/cs4281/cs4281pm-24.c Mon Sep 22 12:59:08 2003 @@ -46,8 +46,8 @@ struct cs4281_state *state; CS_DBGOUT(CS_PM, 2, printk(KERN_INFO - "cs4281: cs4281_pm_callback dev=0x%x rqst=0x%x state=%d\n", - (unsigned)dev,(unsigned)rqst,(unsigned)data)); + "cs4281: cs4281_pm_callback dev=%p rqst=0x%x state=%p\n", + dev,(unsigned)rqst,data)); state = (struct cs4281_state *) dev->data; if (state) { switch(rqst) {